<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>编辑公告</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  
    {include file="public/css"}
    {include file="public/js"}
</head>
<body>

<blockquote class="layui-elem-quote">编辑公告</blockquote>

<div class=""  style="padding:20px">
<form class="layui-form" action="">
<input name="id"  type="hidden" value="{$Request.param.id}">
              <div class="layui-form-item">
                <label class="layui-form-label" style="width:100px;">公告分类</label>
                <div class="layui-input-inline">
                    {:get_cate('notice_category',$notice.cid)}
                </div>
              </div>

              <div class="layui-form-item">
                <label class="layui-form-label" style="width:100px;"> 公告标题</label>
                <div class="layui-input-inline">
                  <input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" value="{$notice.title}">
                </div>
              </div>

              <div class="layui-form-item">
                <label class="layui-form-label" style="width:100px;">状态</label>
                <div class="layui-input-inline">
                <input type="checkbox" class="status"  name="status" lay-skin="switch"  lay-filter="switchTarget" lay-text="开启|关闭" {if $notice.status==1}checked{/if}>

                </div>
              </div>

              <div class="layui-form-item">
                <label class="layui-form-label" style="width:100px;">内容</label>
                <div class="layui-input-inline" style="width:700px;">
                        {form:ueditor name="content" value="$notice['content']" /}
                </div>
                   <div class="layui-form-mid layui-word-aux"></div>
              </div>


              <div class="layui-form-item">
                <label class="layui-form-label" style="width:100px;"></label>
                <div class="layui-input-inline">
                  <button class="layui-btn layui-btn-normal"  lay-submit lay-filter="form">确 定</button>
                  <button class="layui-btn layui-btn-primary"  onclick="javascript:history.go(-1);">返 回</button>
                </div>
              </div>


</form>
</div>
<script>
layui.use(['element', 'layer','form'], function(){
   var  element = layui.element, layer = layui.layer,form = layui.form;
  // //监听导航点击

 //监听提交
  form.on('submit(form)', function(data){
    $.post("{:url('notice/edit')}",$("form").serialize(),function(json){
          if(json.code == 0){
            layer.msg(json.msg);
          }else{
            layer.msg(json.msg);
          }
    });
    return false; //阻止表单跳转
  });

});

</script>

</body>

</html>